#ifndef ROCKET_NET_ABSTRACT_CODER_H
#define ROCKET_NET_ABSTRACT_CODER_H

#include "../tcp/tcp_buffer.h"
#include "abstract_protocol.h"
#include <vector>

namespace rocket {

class AbstractCoder {
  public:
    virtual ~AbstractCoder() {}

    // message -> bytes >> buffer
    virtual void encode(std::vector<AbstractProtocol::s_ptr> &messages,
                        TcpBuffer::s_ptr out_buffer) = 0;

    // buffer >> bytes -> message
    virtual void decode(std::vector<AbstractProtocol::s_ptr> &out_messages,
                        TcpBuffer::s_ptr buffer) = 0;
};

} // namespace rocket

#endif
